﻿// <copyright file="MetadataStore.cs" company="Microsoft Corporation">
// Copyright (c) 2009 Microsoft Corporation All Rights Reserved
// </copyright>
// <author>Michael S. Scherotter</author>
// <email>mischero@microsoft.com</email>
// <date>2009-11-30</date>
// <summary>Metadata store</summary>

namespace Webtrends.WebAnalytics.Design
{
    using System.ComponentModel;
    using Microsoft.Windows.Design;
    using Microsoft.Windows.Design.Metadata;

    /// <summary>
    /// The Metadata store for Webtrends.WebAnalytics
    /// </summary>
    public class MetadataStore : IProvideAttributeTable
    {
        #region IProvideAttributeTable Members

        /// <summary>
        /// Gets the attribute table
        /// </summary>
        public AttributeTable AttributeTable
        {
            get 
            {
                AttributeTableBuilder builder = new AttributeTableBuilder();

                builder.AddCustomAttributes(
                    typeof(WebtrendsAnalytics),
                    new DescriptionAttribute(Properties.Resources.Description),
                    new ToolboxCategoryAttribute(Properties.Resources.Analytics));

                builder.AddCustomAttributes(
                    typeof(WebtrendsAnalytics),
                    "Events",
                    BrowsableAttribute.No);

                builder.AddCustomAttributes(
                    typeof(WebtrendsAnalytics),
                    "ApiVersion",
                    new CategoryAttribute(Properties.Resources.Analytics),
                    new DefaultValueAttribute("1"),
                    new DisplayNameAttribute("API Version"),
                    new DescriptionAttribute("The Webtrends API Version"));

                builder.AddCustomAttributes(
                    typeof(WebtrendsAnalytics),
                    "DataSourceId",
                    new CategoryAttribute(Properties.Resources.Analytics),
                    new DisplayNameAttribute("Data Source Id"),
                    new DescriptionAttribute("The Webtrends data source Id"));

                builder.AddCustomAttributes(
                    typeof(WebtrendsAnalytics),
                    "ContentGroup",
                    new CategoryAttribute(Properties.Resources.Analytics),
                    new DisplayNameAttribute("Content Group"),
                    new DescriptionAttribute("The Webtrends content group"));

                builder.AddCustomAttributes(
                    typeof(WebtrendsAnalytics),
                    "CustomParameters",
                    new CategoryAttribute(Properties.Resources.Analytics),
                    new DescriptionAttribute("Name-value pairs for custom application data."),
                    new DisplayNameAttribute("Custom Parameters"));

                builder.AddCustomAttributes(
                    typeof(WebtrendsAnalytics),
                    "Verbose",
                    new CategoryAttribute(Properties.Resources.Analytics),
                    new DescriptionAttribute("Verbose message responses (for debugging purposes)."));

                return builder.CreateTable();
            }
        }

        #endregion
    }
}
